package com.iplant.wms.service.po.wms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;

/**
 * 库位资源
 *
 * @author ShrisJava
 */
@DBBasePO(TableName = "wms_resource", Name = false,Active = false, CheckName = {
        "Code", "StoreStationID,StationID,MaterialID"},
        Schemas = DBSchemas.WMS, CodeAuto = true, CodePrefix = "SRS{yyMMdd}", CodeNum = 5)
public class WMSResource extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 库位
     */
    @DBCondition
    @DBJoin(name = "StoreID", tableName = "wms_store_station", tableAsName = "s1",
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, MainTableField = "StoreStationID")
    public int StoreID = 0;

    @DBJoin(name = "Name", tableName = "wms_store", tableAsName = "s4", JoinIndex = 4,
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, ConditionalJoin = "s1.StoreID=s4.ID")
    public String StoreName = "";
    @DBJoin(name = "Code", tableName = "wms_store", tableAsName = "s4", JoinIndex = 4,
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, ConditionalJoin = "s1.StoreID=s4.ID")
    public String StoreCode = "";

    @DBCondition
    @DBJoin(name = "StoreRegionID", tableName = "wms_store_station", tableAsName = "s1",
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, MainTableField = "StoreStationID")
    public int StoreRegionID = 0;

    @DBJoin(name = "Name", tableName = "wms_store_region", tableAsName = "s3", JoinIndex = 3,
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, ConditionalJoin = "s1.StoreRegionID=s3.ID")

    public String StoreRegionName = "";
    @DBJoin(name = "Name", tableName = "wms_store_region", tableAsName = "s3", JoinIndex = 3,
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, ConditionalJoin = "s1.StoreRegionID=s3.ID")
    public String StoreRegionCode = "";


    @DBCondition
    @DBJoin(name = "StoreAreaID", tableName = "wms_store_station", tableAsName = "s1",
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, MainTableField = "StoreStationID")
    public int StoreAreaID = 0;
    @DBJoin(name = "Name", tableName = "wms_store_area", tableAsName = "s2", JoinIndex = 2,
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, ConditionalJoin = "s1.StoreAreaID=s2.ID")
    public String StoreAreaName = "";
    @DBJoin(name = "Code", tableName = "wms_store_area", tableAsName = "s2", JoinIndex = 2,
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, ConditionalJoin = "s1.StoreAreaID=s2.ID")
    public String StoreAreaCode = "";


    @DBCondition
    @DBJoin(name = "StoreShelfID", tableName = "wms_store_station", tableAsName = "s1",
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, MainTableField = "StoreStationID")
    public int StoreShelfID = 0;

    @DBJoin(name = "Name", tableName = "wms_store_shelf", tableAsName = "ss1", JoinIndex = 3,
            Schemas = DBSchemas.WMS, ConditionalJoin = "s1.StoreShelfID=ss1.ID")

    public String StoreShelfName = "";
    @DBJoin(name = "Code", tableName = "wms_store_shelf", tableAsName = "ss1",JoinIndex = 3,
            Schemas = DBSchemas.WMS, ConditionalJoin = "s1.StoreShelfID=ss1.ID")
    public String StoreShelfCode = "";


    @DBCondition
    @DBField(CheckValue = true)
    public int StoreStationID = 0;
    @DBJoin(name = "Name", tableName = "wms_store_station", tableAsName = "s1",
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, MainTableField = "StoreStationID")
    public String StoreStationName = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "StoreStationCodeEQ")
    @DBJoin(name = "Code", tableName = "wms_store_station", tableAsName = "s1",
            JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.WMS, MainTableField = "StoreStationID")
    public String StoreStationCode = "";

    /**
     * 工位
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.in)
    @DBField(CheckValue = true)
    public int StationID = 0;

    @DBJoin(name = "Code", tableName = "fmc_station", tableAsName = "st1", Schemas = DBSchemas.Basic,
            MainTableField = "StationID")
    public String StationCode = "";

    @DBJoin(name = "Name", tableName = "fmc_station", tableAsName = "st1", Schemas = DBSchemas.Basic,
            MainTableField = "StationID")
    public String StationName = "";


    /**
     * 物料
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.in)
    @DBField
    public int MaterialID = 0;
    @DBJoin(name = "Name", tableName = "mss_material", tableAsName = "m2",
            Schemas = DBSchemas.Basic, MainTableField = "MaterialID")
    public String MaterialCode = "";
    @DBJoin(name = "Name", tableName = "mss_material", tableAsName = "m2",
            Schemas = DBSchemas.Basic, MainTableField = "MaterialID")
    public String MaterialName = "";


    @JsonProperty("StationID")
    public int getStationID() {
        return StationID;
    }

    public void setStationID(int stationID) {
        StationID = stationID;
    }

    @JsonProperty("StationName")
    public String getStationName() {
        return StationName;
    }

    public void setStationName(String stationName) {
        StationName = stationName;
    }

    @JsonProperty("StationCode")
    public String getStationCode() {
        return StationCode;
    }

    public void setStationCode(String stationCode) {
        StationCode = stationCode;
    }

    @JsonProperty("StoreID")
    public int getStoreID() {
        return StoreID;
    }

    public void setStoreID(int storeID) {
        StoreID = storeID;
    }

    @JsonProperty("StoreName")
    public String getStoreName() {
        return StoreName;
    }

    public void setStoreName(String storeName) {
        StoreName = storeName;
    }

    @JsonProperty("StoreCode")
    public String getStoreCode() {
        return StoreCode;
    }

    public void setStoreCode(String storeCode) {
        StoreCode = storeCode;
    }

    @JsonProperty("StoreRegionID")
    public int getStoreRegionID() {
        return StoreRegionID;
    }

    public void setStoreRegionID(int storeRegionID) {
        StoreRegionID = storeRegionID;
    }

    @JsonProperty("StoreRegionName")
    public String getStoreRegionName() {
        return StoreRegionName;
    }

    public void setStoreRegionName(String storeRegionName) {
        StoreRegionName = storeRegionName;
    }

    @JsonProperty("StoreRegionCode")
    public String getStoreRegionCode() {
        return StoreRegionCode;
    }

    public void setStoreRegionCode(String storeRegionCode) {
        StoreRegionCode = storeRegionCode;
    }

    @JsonProperty("StoreAreaID")
    public int getStoreAreaID() {
        return StoreAreaID;
    }

    public void setStoreAreaID(int storeAreaID) {
        StoreAreaID = storeAreaID;
    }

    @JsonProperty("StoreAreaName")
    public String getStoreAreaName() {
        return StoreAreaName;
    }

    public void setStoreAreaName(String storeAreaName) {
        StoreAreaName = storeAreaName;
    }

    @JsonProperty("StoreAreaCode")
    public String getStoreAreaCode() {
        return StoreAreaCode;
    }

    public void setStoreAreaCode(String storeAreaCode) {
        StoreAreaCode = storeAreaCode;
    }

    @JsonProperty("StoreShelfID")
    public int getStoreShelfID() {
        return StoreShelfID;
    }

    public void setStoreShelfID(int storeShelfID) {
        StoreShelfID = storeShelfID;
    }

    @JsonProperty("StoreShelfName")
    public String getStoreShelfName() {
        return StoreShelfName;
    }

    public void setStoreShelfName(String storeShelfName) {
        StoreShelfName = storeShelfName;
    }

    @JsonProperty("StoreShelfCode")
    public String getStoreShelfCode() {
        return StoreShelfCode;
    }

    public void setStoreShelfCode(String storeShelfCode) {
        StoreShelfCode = storeShelfCode;
    }

    @JsonProperty("StoreStationID")
    public int getStoreStationID() {
        return StoreStationID;
    }

    public void setStoreStationID(int storeStationID) {
        StoreStationID = storeStationID;
    }

    @JsonProperty("StoreStationName")
    public String getStoreStationName() {
        return StoreStationName;
    }

    public void setStoreStationName(String storeStationName) {
        StoreStationName = storeStationName;
    }

    @JsonProperty("StoreStationCode")
    public String getStoreStationCode() {
        return StoreStationCode;
    }

    public void setStoreStationCode(String storeStationCode) {
        StoreStationCode = storeStationCode;
    }

    @JsonProperty("MaterialID")
    public int getMaterialID() {
        return MaterialID;
    }

    public void setMaterialID(int materialID) {
        MaterialID = materialID;
    }

    @JsonProperty("MaterialCode")
    public String getMaterialCode() {
        return MaterialCode;
    }

    public void setMaterialCode(String materialCode) {
        MaterialCode = materialCode;
    }

    @JsonProperty("MaterialName")
    public String getMaterialName() {
        return MaterialName;
    }

    public void setMaterialName(String materialName) {
        MaterialName = materialName;
    }
}
